package org.example.product.service.impl;

import org.example.product.entity.ResultBody;
import org.example.product.mapper.EditInfMapper;
import org.example.product.service.EditInfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EditInfServiceimpl implements EditInfService {
    @Autowired
    private EditInfMapper editInfUMapper;

    @Override
    public int editInformation(String name, String username, String sex, String number, String email, String address, String birthday, String avatar_Url) {
        if (editInfUMapper.addMessage(name,username, sex,number,email,address,birthday,avatar_Url) > 0) {
            return 1;
        }
        return 0;
    }
    @Override
    public int findMessage(String number) {
        if (editInfUMapper.findMessage(number) != null) {
            return 1;
        }
        return 0;
    }
    @Override
    public ResultBody UserMessage(String id) {
        if(editInfUMapper.UserMessage(id) != null) {
            return new ResultBody(200,"展示编辑成功",editInfUMapper.UserMessage(id));
        }
        return new ResultBody(400,"展示编辑信息失败",false);
    }
}